Page({
  data: {
    result: ''
  },

  getscancode() {
    wx.scanCode({
      success: (res) => {
        console.log(res.result);
        console.log(res);
        const result = res.result;
        const params = new URLSearchParams(res.result);
        const scene = params.get('scene');

        wx.setStorage({
          key: 'scene',
          data: scene
        });

        const imagePath = '/path/to/scanned/image.png';
        //this.uploadImage(imagePath, result);
      },
      fail: (err) => {
        console.error(err);
      }
    });
  },
  onLoad(options) {},

  onReady() {},

  onShow() {},

  onHide() {},

  onUnload() {},

  onPullDownRefresh() {
    this.setData({
      result: ''
    });
    wx.stopPullDownRefresh();
  },

  onReachBottom() {},

  onShareAppMessage() {}
});
